package health.lm.com.shop.presenter;

import java.util.ArrayList;
import java.util.List;

import health.lm.com.component_base.base.mvp.contract.XPresent;
import health.lm.com.network.callback.SimpleCallBack;
import health.lm.com.shop.entity.CompanyDynamicItemEntity;
import health.lm.com.shop.entity.CompanyDynamicResponse;
import health.lm.com.shop.fragment.HLCompanyDynamicFragment;
import health.lm.com.shop.model.MallModel;

/**
 * @author GQI
 * @description: 智库
 * @date :2019-08-10 14:59
 */
public class HLCompanyDynamicItemPresent extends XPresent<HLCompanyDynamicFragment> {
    public void getListMore(boolean isRefresh, Object layout,String id ,int page, int pageSize) {
//        MineModel.getInstance().aplyCircle(circle_id, page, pageSize, new SimpleCallBack<MyCircleAplyListEntity>() {
//            @Override
//            public void onSuccess(MyCircleAplyListEntity myCircleAplyListEntity) {
//
//                if (hasV()) {
//                    getV().getListSuccess(myCircleAplyListEntity.getBusinessListData());
//                }
//                if (isRefresh) {
//                    ((SmartRefreshLayout)layout).finishRefresh(true);
//                }
//            }
//
//            @Override
//            public void onError(ApiException e) {
//                super.onError(e);
//                if (isRefresh) {
//                    ((SmartRefreshLayout)layout).finishRefresh(true);
//                }
//            }
//        });
        MallModel.getInstance().getHomeNewsData(id, page, pageSize, new SimpleCallBack<CompanyDynamicResponse>() {
            @Override
            public void onSuccess(CompanyDynamicResponse pCompanyDynamicResponse) {
                if (hasV()) getV().getDataSuccess(pCompanyDynamicResponse.getNews_list());
            }
        });
        //List<CompanyDynamicItemEntity> entities = new ArrayList<>();
        //for(int i = 0;i<10;i++){
        //    CompanyDynamicItemEntity entity = new CompanyDynamicItemEntity();
        //    entity.setClick("6754次阅读");
        //    entity.setPic("http://pic32.nipic.com/20130813/3347542_160503703000_2.jpg");
        //    entity.setTitle("第五届中国（临沂）国际百货博览会盛大开幕！"+i);
        //    entity.setType("智库");
        //    entities.add(entity);
        //}
        //getV().getDataSuccess(entities);
    }
}
